home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 2 / CU Amiga Magazine's Super CD-ROM 02 (1996)(EMAP Images)(GB)[!][issue 1996-04].iso / magazine / amiga_e / amigae.jan.archive / 000089_crash!uniwa.uwa…!multi!robbage_Mon, 31 Jan 94 00:59:26 PST.msg < prev    next >
Text File  |  1994-02-17  |  22KB  |  705 lines

  1. Received: by bkhouse.cts.com (V1.17-beta/Amiga)
  2.       id <1p15@bkhouse.cts.com>; Mon, 31 Jan 94 00:59:26 PST
  3. Received: from uniwa.uwa.edu.au by crash.cts.com with smtp
  4.     (Smail3.1.28.1 #18) id m0pQA7v-0000voC; Fri, 28 Jan 94 23:29 PST
  5. Received: from localhost (uucp@localhost) by uniwa.uwa.edu.au (8.6.4/8.6.4) id PAA19547 for bkhouse.cts.com!AmigaE; Sat, 29 Jan 1994 15:29:53 +0800
  6. Received: by multi.multiline.com.au (Smail3.1.28.1 #6)
  7.     id m0pQ8cJ-000C0bC; Sat, 29 Jan 94 13:53 WST
  8. Message-Id: <m0pQ8cJ-000C0bC@multi.multiline.com.au>
  9. Date: Sat, 29 Jan 1994 13:53:11 +0800 (WST)
  10. In-Reply-To: <9401271323.AA02257@plucky.safb.af.mil> from "Barry D Wills" at Jan 27, 94 07:23:27 am
  11. X-Mailer: ELM [version 2.4 PL21]
  12. MIME-Version: 1.0
  13. Content-Type: text/plain; charset=US-ASCII
  14. Content-Transfer-Encoding: 7bit
  15. Content-Length: 1096
  16. From: robbage@multi.multiline.com.au (Rob Nottage)
  17. To: AmigaE@bkhouse.cts.com
  18. Subject: Re: More GUI problems
  19.  
  20. > ~8> >         Gt_SetGadgetAttrsA(clicked,win,NIL,[GTLV_LABELS,$FFFFFFFF])
  21. > ~8> 
  22. > ~8> What about '-1' instead of $FFFFFFFF  ?  :-)
  23. > Heh.  The AutoDocs say "use ~0".  How's that for a language-
  24. > dependent doc?
  25.  
  26. I guess Not(0) would suffice then!  :-)  Should work actually.
  27. Even ALL should work??
  28.  
  29. > ~8> > I guess LISTVIEW's aren't my thing ... :)
  30. > ~8> 
  31. > ~8> I hate them too. We're stuck with them  :-)
  32. > Once you get by the skimpy instructions, listviews are
  33. > awesomely simple.  Don't give up.  If you're still having
  34. > trouble by Friday, mail me privately and I'll post an
  35. > example this weekend.
  36.  
  37. I'm not having any hassles with them myself. I just hate working with them
  38. :-)    I just wrote a short tute for working with listviews for the
  39. Amiga-E echo in AmigaNet.  I find it hard to tell what I know in a
  40. understandable way too  :-)
  41.  
  42.  
  43. -- 
  44.    ___________________________________
  45.   /                                   \
  46.   |  robbage@multi.multiline.com.au   |
  47.   |  Rob Nottage 3:690/662.0@FidoNet  |
  48.   |             41:616/662.0@AmigaNet |
  49.   \___________________________________/
  50. From crash!mpoli.fi!ilkka.anttonen Mon, 31 Jan 94 01:04:01 PST
  51. Received: by bkhouse.cts.com (V1.17-beta/Amiga)
  52.       id <1p6s@bkhouse.cts.com>; Mon, 31 Jan 94 01:04:01 PST
  53. Received: from eunet.fi by crash.cts.com with smtp
  54.     (Smail3.1.28.1 #18) id m0pQUON-0000CJC; Sat, 29 Jan 94 21:08 PST
  55. Received: from mpoli.fi by eunet.fi with UUCP id AA15467
  56.   (5.65c+l/IDA-1.4.4 for AMIGAE@BKHOUSE.CTS.COM); Sun, 30 Jan 1994 07:08:08 +0200
  57. Received: by mpoli (PCB-UUCP 1.1f)
  58.     id FAB2F1; Sun, 30 Jan 94 02:40:26 +0200
  59. Message-Id: <f7.35579.47.0CFAB2F1@mpoli.fi>
  60. Date: Sat, 29 Jan 94 00:54:00 +0200
  61. Organization: Metropoli, Finland
  62. From: ilkka.anttonen@mpoli.fi (Ilkka Anttonen)
  63. To: AMIGAE@BKHOUSE.CTS.COM
  64. Subject: Re: EFormat
  65.  
  66. Am>  Well, that is a bit weird. I've looked at the program, and it is
  67. Am> fine, as far as I can see. The only thing I can see that might be even
  68.  
  69. It is absolutely fine, it has never gurued on me and I'm running an
  70. obsolete KS1.2 with a ZKicked 2.04 on top of it. Works absolutely fine,
  71. nice work..
  72.  
  73. Am> >AddTools
  74. Am> >DropBox
  75. Am> >Exchange
  76. Am> >MagicMenu
  77. Am> >RexxMast
  78. Am> >RTPatch
  79. Am> >Storage
  80. Am> >Yak
  81.  
  82. [These are the commodities the original guru'er has running..]
  83. MagicMenu is NOT the cause of the guru. I have it running all the time and
  84. so far it hasn't done anything illegal. I've never heard about AddTools,
  85. DropBox or Storage, though, so I can't say anything about those.
  86.  
  87. Am> and is running Magic WB. 2. Try it from a bare cli. If it still does it,
  88. Am> without any of those programs, (Magic menus comes immediately to mind as
  89.  
  90. I would suggest the user to try to set a stack size a bit larger. Mine is
  91. 12000 bytes and it's sufficient for everything (excluding Frontier..;)
  92. If that doesn't help, then there are some higher forces working on the
  93. poor chap's computer and I'd advice him to make a quick browse through
  94. the yellow pages on the letter E (as in exorcist..) ;)
  95. --
  96.     ************************************************************
  97.     ** Ilkka Anttonen: Ilkka.Anttonen@mpoli.fi (Yep, Finland) **
  98.     ** Gordian Maxim: If a string has one end, it has another **
  99.     ************************************************************
  100.  
  101.  * Q-Blue 1.0 [NR] *
  102. From crash!uniwa.uwa.edu.au!multi!robbage Mon, 31 Jan 94 01:04:45 PST
  103. Received: by bkhouse.cts.com (V1.17-beta/Amiga)
  104.       id <1p7l@bkhouse.cts.com>; Mon, 31 Jan 94 01:04:45 PST
  105. Received: from uniwa.uwa.edu.au by crash.cts.com with smtp
  106.     (Smail3.1.28.1 #18) id m0pQXYg-00001NC; Sun, 30 Jan 94 00:31 PST
  107. Received: from localhost (uucp@localhost) by uniwa.uwa.edu.au (8.6.4/8.6.4) id QAA27122 for bkhouse.cts.com!AmigaE; Sun, 30 Jan 1994 16:31:01 +0800
  108. Received: by multi.multiline.com.au (Smail3.1.28.1 #6)
  109.     id m0pQVeA-0003N1C; Sun, 30 Jan 94 14:28 WST
  110. Message-Id: <m0pQVeA-0003N1C@multi.multiline.com.au>
  111. Date: Sun, 30 Jan 1994 14:28:38 +0800 (WST)
  112. X-Mailer: ELM [version 2.4 PL21]
  113. MIME-Version: 1.0
  114. Content-Type: text/plain; charset=US-ASCII
  115. Content-Transfer-Encoding: 7bit
  116. Content-Length: 1190
  117. From: robbage@multi.multiline.com.au (Rob Nottage)
  118. To: AmigaE@bkhouse.cts.com
  119. Subject: crashing from workbench
  120.  
  121. I have a program I've been playing with for some time and always from the
  122. shell.  Today I decided to make an icon for it and see how it went.
  123. It didn't  :-(   Alert 80000004
  124. After spending some time debugging, I found that it crashes upon actually
  125. loading it??  I have...
  126.  
  127. PROC main()
  128.   DEF <some variables>
  129.   WriteF('You made it this far\n')
  130. ..........
  131. other code
  132. ..........
  133.  
  134. According to the reference doc, Amiga E will open a console window for us
  135. if we use WriteF() when the program is run from workbench.
  136. Previous programs have proven this true. This program, however, causes
  137. an Alert even before the window is opened!?!?!
  138. All I've done before that line is DEFined some variables.
  139. The program does what I expect it to do, when run from CLI.
  140. I don't think it has anythng to do with whether there is an Output
  141. available for WriteF() because I can replace that line with:
  142.  
  143. DisplayBeep(NIL)
  144.  
  145. and it crashes before that even!
  146.  
  147. Any suggestions??
  148.  
  149.  
  150. -- 
  151.    ___________________________________
  152.   /                                   \
  153.   |  robbage@multi.multiline.com.au   |
  154.   |  Rob Nottage 3:690/662.0@FidoNet  |
  155.   |             41:616/662.0@AmigaNet |
  156.   \___________________________________/
  157. From crash!dtek.chalmers.se!d2hacker Mon, 31 Jan 94 01:05:05 PST
  158. Received: by bkhouse.cts.com (V1.17-beta/Amiga)
  159.       id <1p82@bkhouse.cts.com>; Mon, 31 Jan 94 01:05:05 PST
  160. Received: from hacket.dtek.chalmers.se by crash.cts.com with smtp
  161.     (Smail3.1.28.1 #18) id m0pQaUf-0000NqC; Sun, 30 Jan 94 03:39 PST
  162. Received: from localhost (d2hacker@localhost) by hacket.dtek.chalmers.se (8.6.4/8.6.4) id MAA28207 for amigae@bkhouse.cts.com; Sun, 30 Jan 1994 12:39:08 +0100
  163. Message-Id: <199401301139.MAA28207@hacket.dtek.chalmers.se>
  164. Date: Sun, 30 Jan 1994 12:39:07 +0100 (MET)
  165. X-Mailer: ELM [version 2.4 PL22]
  166. MIME-Version: 1.0
  167. Content-Type: text/plain; charset=us-ascii
  168. Content-Transfer-Encoding: 7bit
  169. Content-Length: 1396
  170. From: Magnus Hacker <d2hacker@dtek.chalmers.se>
  171. To: amigae@bkhouse.cts.com (AmigaE Mailing List)
  172. Subject: Re: Thanks for the help
  173.  
  174. thorntonj@beast.cs.hh.ab.com wrote:
  175.  
  176. <stuff deleted>
  177.  
  178. >I havn't had time to do more than just type in the above and get it 
  179. >working. If I wanted to open more than one console, and draw a map in it,
  180. >I could define it as, say, mapcon and then open it with:
  181. >
  182. >    IF mapcon:=Open('mapcon:xx/xx/xxx/xxx/XXXXX',NEWFILE)
  183. >    ENDIF
  184. >
  185. >or something along that line. Then to write to that console with:
  186. >
  187. >   Write(mapcon,'Whatever',STRLEN)
  188. >
  189. >Am I one the right track with this.
  190.  
  191. Almost. The IF statement should read:
  192.  
  193.     IF mapcon:=Open('con:xx/xx/xxx/xxx/XXXXX',NEWFILE)
  194.  
  195. CON: is a AmigaDOS device just like df0: or dh0: but mapcon: means nothing
  196. to AmigaDOS.
  197. The program would compile fine, but when you run it, you will get a requester
  198. telling you to "Insert disk "mapcon" in any disk drive".
  199.  
  200. Just use different variables for different windows, and then you're on
  201. the right track.
  202.  
  203. BTW, wouldn't it be easier to open a normal window for the map, and use
  204. Line() to draw in it? Opening a console window for this means that you have
  205. to use ascii characters to make up the map. Just a thought.
  206.  
  207. See you,
  208. +--------------------------------------------------+-------------------+
  209. | Magnus Hacker, Chalmers Univ. of Technology      |     This space    |
  210. | d2hacker@dtek.chalmers.se                        |      for rent     |
  211. +--------------------------------------------------+-------------------+  
  212. From crash!mhd1.moorhead.msus.edu!platt Mon, 31 Jan 94 01:05:21 PST
  213. Received: by bkhouse.cts.com (V1.17-beta/Amiga)
  214.       id <1p8d@bkhouse.cts.com>; Mon, 31 Jan 94 01:05:21 PST
  215. Received: from mhd1.moorhead.msus.edu by crash.cts.com with smtp
  216.     (Smail3.1.28.1 #18) id m0pQbg0-0000FFC; Sun, 30 Jan 94 04:54 PST
  217. Received: by mhd1.moorhead.msus.edu (5.65/DEC-Ultrix/4.3)
  218.     id AA09720; Sun, 30 Jan 1994 06:55:45 -0600
  219. Message-Id: <9401301255.AA09720@mhd1.moorhead.msus.edu>
  220. Date: Sun, 30 Jan 1994 06:55:44 -0600 (CST)
  221. X-Mailer: ELM [version 2.4 PL20]
  222. Content-Type: text
  223. Content-Length: 12012
  224. From: platt@mhd1.moorhead.msus.edu (Vincent Platt)
  225. To: amigae@bkhouse.cts.com (amigae)
  226. Subject: Programmer Project Interface Source
  227.  
  228. This is the source code for PPI, which I just posted to Aminet.  You can
  229. get the source from there too, but I wanted to make sure all the E'ers got
  230. a shot at it (not like we look at every little upload on Aminet eh?).
  231.  
  232. The docs are in the Aminet distribution too, if you have more questions.
  233.  
  234. Mail me for questions about this (platt@mhd1.moorhead.msus.edu).
  235.  
  236. Do NOT flood the list with questions.
  237.  
  238. Oh, be sure to edit out my .signature from the end of this mail message
  239. and edit out this prelude too.  Just reminding everyone!  :+)
  240.  
  241. /*
  242.  
  243. PPI - Programming Project Interface
  244.  
  245. Meant to satisfy all the 'would-have-been' users of ESEE.
  246.  
  247. Written by Vincent Platt - (c) 1994 - All Rights Reserved
  248. Modifying & distributing this source is prohibited.
  249. Source may be modified for own personal use.
  250.  
  251. This program and its source are freeware and no charge may be
  252. made for this program, its source, or its documentation.
  253.  
  254. SrcGen used to create original code skeleton.
  255.  
  256. A modified version of Eformat was used to make things uniform.
  257. (My version makes indents a single space, rather than a tab char.)
  258.  
  259.  
  260. */
  261.  
  262. OPT OSVERSION=37
  263.  
  264. MODULE 'gadtools','libraries/gadtools','intuition/intuition',
  265. 'intuition/screens', 'intuition/gadgetclass', 'graphics/text',
  266. 'Asl', 'libraries/Asl', 'dos/dos'
  267.  
  268. ENUM NONE, NOCONTEXT, NOGADGET, NOWB, NOVISUAL, OPENGT, NOWINDOW, NOMENUS
  269. ENUM EDIT_BUTTON, COMPILE_BUTTON, ACTION1_BUTTON, ACTION2_BUTTON,
  270. PICK_BUTTON, SAVESETTINGS_BUTTON, EDITOR_STRING, COMPILER_STRING,
  271. ACTION1_STRING, ACTION2_STRING, KILL_CBOX
  272. ENUM EDIT, COMPILE, ACTION1, ACTION2
  273.  
  274. DEF ppiwnd:PTR TO window, ppiglist, scr:PTR TO screen, visual=NIL,
  275. offx,offy,tattr
  276.  
  277. /* strings for launch's and files */
  278.  
  279. DEF pickfile[256]:STRING, compile[256]:STRING, edit[256]:STRING,
  280. action1[256]:STRING, action2[256]:STRING
  281.  
  282. /* for the checkbox */
  283. DEF checked=TRUE
  284.  
  285. PROC setupscreen()
  286.  IF (gadtoolsbase:=OpenLibrary('gadtools.library',37))=NIL THEN RETURN OPENGT
  287.  IF (scr:=LockPubScreen('Workbench'))=NIL THEN RETURN NOWB
  288.  IF (visual:=GetVisualInfoA(scr,NIL))=NIL THEN RETURN NOVISUAL
  289.  offy:=scr.wbortop+Int(scr.rastport+58)-10
  290.  tattr:=['topaz.font',8,0,0]:textattr
  291. ENDPROC
  292.  
  293. PROC closedownscreen()
  294.  IF visual THEN FreeVisualInfo(visual)
  295.  IF scr THEN UnlockPubScreen(NIL,scr)
  296.  IF gadtoolsbase THEN CloseLibrary(gadtoolsbase)
  297. ENDPROC
  298.  
  299. PROC openppiwindow()
  300.  DEF g:PTR TO gadget
  301.  IF (g:=CreateContext({ppiglist}))=NIL THEN RETURN NOCONTEXT
  302.  
  303.  IF (g:=CreateGadgetA(BUTTON_KIND,g,
  304.   [offx+410,offy+22,120,19,'_Edit',tattr,EDIT_BUTTON,16,visual,0]:newgadget,
  305.   [GT_UNDERSCORE,"_",
  306.   NIL]))=NIL THEN RETURN NOGADGET
  307.   IF (g:=CreateGadgetA(BUTTON_KIND,g,
  308.    [offx+410,offy+40,120,19,'_Compile',tattr,COMPILE_BUTTON,16,visual,0]:newgadget,
  309.    [GT_UNDERSCORE,"_",
  310.    NIL]))=NIL THEN RETURN NOGADGET
  311.    IF (g:=CreateGadgetA(BUTTON_KIND,g,
  312.     [offx+410,offy+58,120,19,'Action _1',tattr,ACTION1_BUTTON,16,visual,0]:newgadget,
  313.     [GT_UNDERSCORE,"_",
  314.     NIL]))=NIL THEN RETURN NOGADGET
  315.     IF (g:=CreateGadgetA(BUTTON_KIND,g,
  316.      [offx+410,offy+76,120,19,'Action _2',tattr,ACTION2_BUTTON,16,visual,0]:newgadget,
  317.      [GT_UNDERSCORE,"_",
  318.      NIL]))=NIL THEN RETURN NOGADGET
  319.      IF (g:=CreateGadgetA(BUTTON_KIND,g,
  320.       [offx+410,offy+94,120,19,'_Pick',tattr,PICK_BUTTON,16,visual,0]:newgadget,
  321.       [GT_UNDERSCORE,"_",
  322.       NIL]))=NIL THEN RETURN NOGADGET
  323.       IF (g:=CreateGadgetA(BUTTON_KIND,g,
  324.        [offx+410,offy+112,120,19,'_Save Settings',tattr,SAVESETTINGS_BUTTON,16,visual,0]:newgadget,
  325.        [GT_UNDERSCORE,"_",
  326.        NIL]))=NIL THEN RETURN NOGADGET
  327.  
  328.        IF (g:=CreateGadgetA(STRING_KIND,g,
  329.         [offx+96,offy+23,224,12,'Editor:',tattr,EDITOR_STRING,1,visual,0]:newgadget,
  330.         [GTST_MAXCHARS,256,GTST_STRING,edit,
  331.         NIL]))=NIL THEN RETURN NOGADGET
  332.         IF (g:=CreateGadgetA(STRING_KIND,g,
  333.          [offx+97,offy+42,224,12,'Compiler:',tattr,COMPILER_STRING,1,visual,0]:newgadget,
  334.          [GTST_MAXCHARS,256,GTST_STRING,compile,
  335.          NIL]))=NIL THEN RETURN NOGADGET
  336.          IF (g:=CreateGadgetA(STRING_KIND,g,
  337.           [offx+97,offy+61,224,12,'Action 1:',tattr,ACTION1_STRING,1,visual,0]:newgadget,
  338.           [GTST_MAXCHARS,256,GTST_STRING,action1,
  339.           NIL]))=NIL THEN RETURN NOGADGET
  340.           IF (g:=CreateGadgetA(STRING_KIND,g,
  341.            [offx+96,offy+80,224,12,'Action 2:',tattr,ACTION2_STRING,1,visual,0]:newgadget,
  342.            [GTST_MAXCHARS,256,GTST_STRING,action2,
  343.            NIL]))=NIL THEN RETURN NOGADGET
  344.  
  345.            IF (g:=CreateGadgetA(CHECKBOX_KIND,g,
  346.             [offx+170,offy+115,26,11,'Kill Extension For Compiling',tattr,KILL_CBOX,4,visual,0]:newgadget,
  347.             [GTCB_CHECKED,checked,
  348.             NIL]))=NIL THEN RETURN NOGADGET
  349.  
  350.             IF (ppiwnd:=OpenWindowTagList(NIL,
  351.              [WA_LEFT,0,
  352.              WA_TOP,17,
  353.              WA_WIDTH,offx+579,
  354.              WA_HEIGHT,offy+149,
  355.              WA_IDCMP,IDCMP_GADGETUP+IDCMP_CLOSEWINDOW+IDCMP_VANILLAKEY,
  356.              WA_FLAGS,WFLG_DEPTHGADGET+WFLG_SMART_REFRESH+WFLG_DRAGBAR+WFLG_CLOSEGADGET+WFLG_RMBTRAP,
  357.              WA_TITLE,'Programming Project Interface (PPI) -- (c) 1994 Vincent Platt',
  358.              WA_CUSTOMSCREEN,scr,
  359.              WA_MINWIDTH,67,
  360.              WA_MINHEIGHT,21,
  361.              WA_MAXWIDTH,$23A,
  362.              WA_MAXHEIGHT,145,
  363.              WA_AUTOADJUST,1,
  364.              WA_AUTOADJUST,1,
  365.              WA_GADGETS,ppiglist,
  366.              NIL]))=NIL THEN RETURN NOWINDOW
  367.              Gt_RefreshWindow(ppiwnd,NIL)
  368.  
  369. ENDPROC
  370.  
  371. PROC closeppiwindow()
  372.  IF ppiwnd THEN CloseWindow(ppiwnd)
  373.  IF ppiglist THEN FreeGadgets(ppiglist)
  374. ENDPROC
  375.  
  376. PROC reporterr(er)
  377.  DEF erlist:PTR TO LONG
  378.  IF er
  379.   erlist:=['get context','create gadget','lock wb','get visual infos',
  380.   'open "gadtools.library" v37+','open window','create menus']
  381.   EasyRequestArgs(0,[20,0,0,'Could not \s!','ok'],0,[erlist[er-1]])
  382.  ENDIF
  383. ENDPROC er
  384.  
  385. PROC request_file()
  386.  
  387.  DEF req:PTR TO filerequestr
  388.  DEF a[2]:STRING
  389.  
  390.  IF aslbase:=OpenLibrary('asl.library',37)
  391.   IF req:=AllocFileRequest()
  392.    RequestFile(req)
  393.  
  394.    /* first see if the user bothered to pick a file, if not then get out */
  395.    IF StrCmp(req.file,'',ALL) THEN JUMP getout
  396.  
  397.    /* copy path name to our full file name string */
  398.    StrCopy(pickfile,req.dir,ALL)
  399.  
  400.    /* tack a '/' on to the end of pickfile if req.dir is not empty and
  401.    the last char of req.dir is not ':' */
  402.    IF (StrCmp(req.dir,'',ALL)=FALSE)
  403.     MidStr(a,req.dir,StrLen(req.dir)-1,ALL)
  404.     IF (StrCmp(a,':',ALL)=FALSE)
  405.      StrAdd(pickfile,'/',ALL)
  406.     ENDIF
  407.    ENDIF
  408.  
  409.    /* then tack the filename on to the end of pickfile */
  410.    StrAdd(pickfile,req.file,ALL)
  411.  
  412.    getout:
  413.    FreeFileRequest(req)
  414.   ELSE
  415.    WriteF('Could not open filerequester!\n')
  416.   ENDIF
  417.   CloseLibrary(aslbase)
  418.  ELSE
  419.   WriteF('Could not open asl.library!\n')
  420.  ENDIF
  421. ENDPROC
  422.  
  423.  
  424. PROC launch(whichone)
  425.  DEF orgstr[256]:STRING
  426.  DEF str[256]:STRING
  427.  DEF x, test[1]:STRING
  428.  DEF oldpickfile[256]:STRING
  429.  StrCopy(str,'',ALL)
  430.  
  431.  /* this is done so the compile section can mess with the pickfile
  432.  pickfile is restored when everything is done */
  433.  StrCopy(oldpickfile,pickfile,ALL)
  434.  
  435.  SELECT whichone
  436.  
  437.   CASE EDIT
  438.    StrCopy(orgstr,edit,ALL)
  439.  
  440.   CASE COMPILE
  441.    IF checked
  442.     FOR x:= StrLen(pickfile)-1 TO 0 STEP -1
  443.      MidStr(test,pickfile,x,1)
  444.      IF StrCmp(test,'.',ALL)
  445.       StrCopy(pickfile,pickfile,x)
  446.      ENDIF
  447.     ENDFOR
  448.    ENDIF
  449.    StrCopy(orgstr,compile,ALL)
  450.  
  451.   CASE ACTION1
  452.    StrCopy(orgstr,action1,ALL)
  453.  
  454.   CASE ACTION2
  455.    StrCopy(orgstr,action2,ALL)
  456.  
  457.  ENDSELECT
  458.  
  459.  FOR x:= 0 TO StrLen(orgstr)-1
  460.   MidStr(test,orgstr,x,1)
  461.   IF StrCmp(test,'%',ALL)
  462.    MidStr(test,orgstr,x+1,1)
  463.    IF StrCmp(test,'s',ALL)
  464.     StrAdd(str,pickfile,ALL)
  465.     INC x /* inc to skip the s as well as the % */
  466.     JUMP z /* don't add % and s chars now that they have been handled */
  467.    ELSE
  468.     StrAdd(str,'%',ALL)
  469.    ENDIF
  470.   ENDIF
  471.   StrAdd(str,test,ALL)
  472.   z:
  473.  ENDFOR
  474.  
  475.  Execute(str,0,0)
  476.  StrCopy(pickfile,oldpickfile,ALL)
  477.  
  478. ENDPROC
  479.  
  480.  
  481. PROC pick()
  482.  request_file()
  483.  TextF(18,140,'Workfile =                                                         ')
  484.  TextF(18,140,'Workfile = \s',pickfile)
  485. ENDPROC
  486.  
  487. PROC savesettings()
  488.  DEF file
  489.  
  490.  IF file:= Open('s:PPI.prefs', NEWFILE)
  491.   Fputs(file,'PPI Prefs\n')
  492.  
  493.   Fputs(file,pickfile)
  494.   Fputs(file,'\n')
  495.  
  496.   Fputs(file,edit)
  497.   Fputs(file,'\n')
  498.  
  499.   Fputs(file,compile)
  500.   Fputs(file,'\n')
  501.  
  502.   Fputs(file,action1)
  503.   Fputs(file,'\n')
  504.  
  505.   Fputs(file,action2)
  506.   Fputs(file,'\n')
  507.  
  508.   IF checked
  509.    Fputs(file,'T\n')
  510.   ELSE
  511.    Fputs(file,'F\n')
  512.   ENDIF
  513.  
  514.   Close(file)
  515.  ENDIF
  516. ENDPROC
  517.  
  518. PROC loadsettings()
  519.  DEF file
  520.  DEF buf[260]:STRING
  521.  
  522.  IF file:= Open('s:PPI.prefs', OLDFILE)
  523.   Fgets(file,buf,260)
  524.  
  525.   StrCopy(buf,'',ALL)
  526.   Fgets(file,buf,260)
  527.   StrCopy(pickfile,buf,StrLen(buf)-1)
  528.  
  529.   StrCopy(buf,'',ALL)
  530.   Fgets(file,buf,260)
  531.   StrCopy(edit,buf,StrLen(buf)-1)
  532.  
  533.   StrCopy(buf,'',ALL)
  534.   Fgets(file,buf,260)
  535.   StrCopy(compile,buf,StrLen(buf)-1)
  536.  
  537.   StrCopy(buf,'',ALL)
  538.   Fgets(file,buf,260)
  539.   StrCopy(action1,buf,StrLen(buf)-1)
  540.  
  541.   StrCopy(buf,'',ALL)
  542.   Fgets(file,buf,260)
  543.   StrCopy(action2,buf,StrLen(buf)-1)
  544.  
  545.   StrCopy(buf,'',ALL)
  546.   Fgets(file,buf,260)
  547.   StrCopy(buf,buf,StrLen(buf)-1)
  548.  
  549.   IF StrCmp(buf,'F',ALL)
  550.    checked:=FALSE
  551.   ELSE
  552.    checked:=TRUE
  553.   ENDIF
  554.   Close(file)
  555.  
  556.  ELSE
  557.   Close(file)
  558.  ENDIF
  559. ENDPROC
  560.  
  561. PROC main()
  562.  
  563.  DEF class, code, iaddress, dummy: PTR TO stringinfo, dummy2
  564.  DEF mes: PTR TO intuimessage
  565.  DEF clicked: PTR TO gadget, gadgetid
  566.  
  567.  loadsettings()
  568.  
  569.  IF reporterr(setupscreen())=0
  570.   reporterr(openppiwindow())
  571.  
  572.   stdrast:=ppiwnd.rport
  573.   Colour(1,0)
  574.   TextF(18,140,'Workfile = \s',pickfile)
  575.  
  576.   LOOP
  577.    class:=FALSE
  578.    REPEAT
  579.     IF mes:=Gt_GetIMsg(ppiwnd.userport)
  580.      class:=mes.class
  581.      code:=mes.code
  582.      iaddress:=mes.iaddress
  583.      Gt_ReplyIMsg(mes)
  584.      IF class=IDCMP_REFRESHWINDOW
  585.       Gt_BeginRefresh(ppiwnd)
  586.       Gt_EndRefresh(ppiwnd,TRUE)
  587.       TextF(18,140,'Workfile =                                                         ')
  588.       TextF(18,140,'Workfile = \s',pickfile)
  589.       class:=FALSE
  590.      ELSEIF ((class<>IDCMP_CLOSEWINDOW) AND (class<>IDCMP_GADGETUP) AND (class<>IDCMP_VANILLAKEY))
  591.       class:=FALSE
  592.      ENDIF
  593.     ELSE
  594.      WaitPort(ppiwnd.userport)
  595.     ENDIF
  596.    UNTIL class
  597.  
  598.    SELECT class
  599.  
  600.     CASE IDCMP_CLOSEWINDOW
  601.      BRA x
  602.  
  603.     CASE IDCMP_VANILLAKEY
  604.      /* here we must check to see if one of our hotkeys were pressed and
  605.      then react appropriately for each case */
  606.  
  607.      SELECT code
  608.  
  609.       /* "e" or "E" = Edit Button */
  610.       CASE "e"
  611.        launch(EDIT)
  612.       CASE "E"
  613.        launch(EDIT)
  614.  
  615.        /* "c" or "C" = Compile Button */
  616.       CASE "c"
  617.        launch(COMPILE)
  618.       CASE "C"
  619.        launch(COMPILE)
  620.  
  621.        /* "1" = Action1 Button */
  622.       CASE "1"
  623.        launch(ACTION1)
  624.  
  625.        /* "2" = Action2 Button */
  626.       CASE "2"
  627.        launch(ACTION2)
  628.  
  629.        /* "p" or "P" = Pick Button */
  630.       CASE "p"
  631.        pick()
  632.       CASE "P"
  633.        pick()
  634.  
  635.        /* "s" or "S" = SaveSettings Button */
  636.       CASE "s"
  637.        savesettings()
  638.       CASE "S"
  639.        savesettings()
  640.  
  641.      ENDSELECT
  642.  
  643.  
  644.     CASE IDCMP_GADGETUP
  645.      clicked:=iaddress
  646.      gadgetid:=clicked.gadgetid
  647.  
  648.      SELECT gadgetid
  649.       CASE EDIT_BUTTON
  650.        launch(EDIT)
  651.  
  652.       CASE COMPILE_BUTTON
  653.        launch(COMPILE)
  654.  
  655.       CASE ACTION1_BUTTON
  656.        launch(ACTION1)
  657.  
  658.       CASE ACTION2_BUTTON
  659.        launch(ACTION2)
  660.  
  661.       CASE PICK_BUTTON
  662.        pick()
  663.  
  664.       CASE SAVESETTINGS_BUTTON
  665.        savesettings()
  666.  
  667.       CASE EDITOR_STRING
  668.        dummy := clicked.specialinfo
  669.        dummy2 := dummy.buffer
  670.        StrCopy(edit, dummy2, ALL)
  671.  
  672.       CASE COMPILER_STRING
  673.        dummy := clicked.specialinfo
  674.        dummy2 := dummy.buffer
  675.        StrCopy(compile, dummy2, ALL)
  676.  
  677.       CASE ACTION1_STRING
  678.        dummy := clicked.specialinfo
  679.        dummy2 := dummy.buffer
  680.        StrCopy(action1, dummy2, ALL)
  681.  
  682.       CASE ACTION2_STRING
  683.        dummy := clicked.specialinfo
  684.        dummy2 := dummy.buffer
  685.        StrCopy(action2, dummy2, ALL)
  686.  
  687.       CASE KILL_CBOX
  688.        IF checked
  689.         checked:=FALSE
  690.        ELSE
  691.         checked:=TRUE
  692.        ENDIF
  693.  
  694.      ENDSELECT
  695.    ENDSELECT
  696.  
  697.   ENDLOOP
  698.  
  699.  ENDIF
  700.  x: closedownscreen()
  701.  closeppiwindow()
  702.  CleanUp(0)
  703. ENDPROC